package com.aistar.service.impl;

import com.aistar.mapper.BigProductMapper;
import com.aistar.pojo.BigProduct;
import com.aistar.pojo.BigProductExample;
import com.aistar.service.BigProductService;
import com.aistar.util.ServerResponse;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BigProductServiceImpl implements BigProductService {

    @Autowired
    BigProductMapper bigProductMapper;

    @Override
    public ServerResponse save(BigProductService bigProductService) {
        return null;
    }

    @Override
    public ServerResponse modifyStatus(BigProductService bigProductService) {
        return null;
    }

    @Override
    public ServerResponse modify(BigProductService bigProductService) {
        return null;
    }

    @Override
    public ServerResponse getById(Integer id) {
        BigProductExample example = new BigProductExample();
        BigProductExample.Criteria  criteria = example.createCriteria();
        criteria.andBigStatusEqualTo(1);
        criteria.andBigIdEqualTo(id);
        BigProduct bigProduct = new BigProduct();
        return ServerResponse.getDataSuccess(bigProduct);
    }

    @Override
    public ServerResponse getAll() {
        return null;
    }

    @Override
    public List<BigProduct> getByBigName(String bigName) {
        BigProductExample example = new BigProductExample();
        BigProductExample.Criteria criteria = example.createCriteria();
        criteria.andBigStatusEqualTo(1);
        criteria.andBigNameEqualTo(bigName);
        return bigProductMapper.selectByExample(example);
    }
}
